package com.programmingeyeclient.eduemployment.controller;

import com.programmingeyeclient.carousel.entity.Employment;
import com.programmingeyeclient.eduemployment.entity.Eduemployment;
import com.programmingeyeclient.eduemployment.service.EduemploymentService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 就业路径包控制层
 */
@RestController
@AllArgsConstructor
@RequestMapping("/edu_eduemployment")
@CrossOrigin
@Api(value = "就业路径包", tags = "就业路径包接口")
public class EduemploymentController {

    @Autowired
    private EduemploymentService eduemploymentService;

    //查询
    @GetMapping("/eduemployment")
    public List<Eduemployment> list(){
        System.out.println("就业路径包:-------------"+eduemploymentService.ListEduemployment());
        return eduemploymentService.ListEduemployment();
    }

    //根据id查询信息
    @GetMapping("eduemploymentId")
    public Map<String,Object> listId(Integer id){
        Map<String, Object> map = new HashMap<>();
        Eduemployment eduemployment = eduemploymentService.getEduemploymentId(id);
        map.put("data",eduemployment);
        return map;
    }
}
